<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>92Play后台管理</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/managercss.css" />
<style type="text/css">
<!--
body {
	margin-left: 5px;
	margin-top: 5px;
	margin-right: 5px;
	background:#EFEFEF;
}
-->
</style>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.4.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.form.js"></script>
<script type="text/javascript">
	var ctp = '<%=request.getContextPath() %>';
	$(function(){
		$("#add").click(function(){
				var date = $("#companyForm").formSerialize();
				$.ajax({
					url:ctp+"/admin/sp/fenpei",
					data:date,
					type:"POST",
					success:function(flag){
						if(flag=='1'){
							alert("添加成功!");
							//window.location.href= ctp+"/admin/company";
							 parent.location.reload();
						}else{
							alert("添加失败!");
						}
					}
				});
				return;
			
		});
	});
</script>
</head>
<body>
<div class="information">
	<div class="list">
		<form method="post" id="companyForm">
		<div class="noselect">
		<input type="hidden" name="spcode" id="spcode" value="${spBean.spcode}">
		<input type="hidden" name="spid" id="spid" value="${spBean.id}">
		<input type="hidden" name="spfee" id="spfee" value="${spBean.spfee}">
		<input type="hidden" name="spisp" id="spisp" value="${spBean.spisp}">
		<input type="hidden" name="spprovince" id="spprovince" value="${spBean.spprovince}">
			<ul>
				<li style="width: 100px;text-align: right;">CP名称：</li>
				<li style="width: 300px;text-align: left;">
					<select name="cpid">
					<c:forEach items="${adminUserList}" var="bean">
						<option value="${bean.id}">${bean.cpname }</option>
					</c:forEach>
					</select>
				</li>
			</ul>
			<div class="clear"></div>
			<ul>
				<li style="width: 100px;text-align: right;">SP名称：</li>
				<li style="width: 300px;text-align: left;">
					${spBean.spname }
				</li>
			</ul>
			<div class="clear"></div>
			<ul>
				<li style="width: 100px;text-align: right;">SP通道：</li>
				<li style="width: 300px;text-align: left;">
					${spBean.spcode }
				</li>
			</ul>
			<div class="clear"></div>
			<ul>
				<li style="width: 100px;text-align: right;">sp指令：</li>
				<li style="width: 300px;text-align: left;">
					${spBean.spcommand }
				</li>
			</ul>
			<div class="clear"></div>
			<ul>
				<li style="width: 100px;text-align: right;">资费：</li>
				<li style="width: 300px;text-align: left;">
					${spBean.spfee/100 }元
				</li>
			</ul>
			<div class="clear"></div>
			<ul>
				<li style="width: 100px;text-align: right;">省份支持：</li>
				<li style="width: 300px;text-align: left;">
					${spBean.province }
				</li>
			</ul>
			<div class="clear"></div>
			<ul>
				<li style="width: 100px;text-align: right;">通道类型：</li>
				<li style="width: 300px;text-align: left;">
					<c:if test="${spBean.spstatus==3}">
						<font color="red">精确已分配</font>
					</c:if>
					<c:if test="${spBean.spstatus==1}">
						精确可用
					</c:if>
					<c:if test="${spBean.spstatus==2}">
						模糊可用
					</c:if>
					<c:if test="${spBean.spstatus==0}">
						<font color="red">停止</font>
					</c:if>
				</li>
			</ul>
			<div class="clear"></div>
			<c:if test="${spBean.spstatus==1}">
			<ul>
				<li style="width: 100px;text-align: right;">&nbsp;</li>
				<li style="width: 300px;text-align: left;">
					<input type="hidden" name="spcommand" id="spcommand" value="${spBean.spcommand}">
					<input type="button" id="add" value="提 交" /> 
				</li>
			</ul>
			<div class="clear"></div>	
			</c:if>
			<c:if test="${spBean.spstatus==2}">
			<ul>
				<li style="width: 100px;text-align: right;">已分配模糊指令：</li>
				<li style="width: 300px;text-align: left;">
					
					${command }
				</li>
			</ul>
			<div class="clear"></div>
			<ul>
				<li style="width: 100px;text-align: right;">分配模糊指令：</li>
				<li style="width: 300px;text-align: left;">
					<input type="text" name="spcommand" id="spcommand" value="${spBean.spcommand}">
				</li>
			</ul>
			<div class="clear"></div>
			<ul>
				<li style="width: 100px;text-align: right;">&nbsp;</li>
				<li style="width: 300px;text-align: left;">
					<input type="button" id="add" value="提 交" /> 
				</li>
			</ul>
			<div class="clear"></div>	
			</c:if>
			
			
		</div>
		</form>
	</div>
</div>
</body>
</html>